package shira.seminar;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;

import org.junit.Before;
import org.junit.Test;

import shira.person.Educative;
import shira.person.Ken;
import shira.person.Ken.Mahoz;
import shira.seminar.Camp;
import shira.seminar.Hug;
import shira.sort.SortingScore;

/**
 * Test for the {@link Camp} class.
 * 
 * @author avian
 */
public class CampTest {

	/* --- Test Methods --- */
	
	/**
	 * Setup for the tests. 
	 */
	@Before
	public void setUp() {
		testedCamp = new Camp("Fun camp");
	}
	
	/**
	 * Tests the calculation of the mahoz score. 
	 */
	@Test
	public void testMahozScoreCalculation() {
		Ken firstKen = new Ken();
		firstKen.setMahoz(Mahoz.HAIFA);
		Ken secondKen = new Ken();
		secondKen.setMahoz(Mahoz.JERUSALEM);
		Hug hug = new Hug();
		hug.setCamp(testedCamp);
		testedCamp.setHugs(Arrays.asList(hug));
		Educative firstEducative = new Educative();
		firstEducative.setKen(firstKen);
		Educative secondEducative = new Educative();
		secondEducative.setKen(secondKen);
		Educative thirdEducative = new Educative();
		thirdEducative.setKen(secondKen);
		hug.addEducative(firstEducative);
		hug.addEducative(secondEducative);
		hug.addEducative(thirdEducative);
		SortingScore score = new SortingScore(1, 1, 1, 1, 1, 2);
		int calculatedScore = testedCamp.calculateMahozScore(score);
		assertEquals(10, calculatedScore);
	}
	
	/* --- Data Members --- */
	
	/** The {@link Camp} under test. */
	Camp testedCamp;

}
